<?php
namespace app\index\controller;
use app\model\Config as ConfigModel;
use think\Db;


class Config extends Base
{
    protected $noCheckToken = ['read','moreRead'];

    /**
     * 获取详情
     * @Author   cch
     * @DateTime 2020-05-26T17:22:45+0800
     * @return   [type]                   [description]
     */
    public function read($key){
        $model = new ConfigModel();
        $data = $model->field('key,name,value')->where('key',$key)->find();
        return apiResult('2000','获取成功',$data);
    }

    public function moreRead($key){
        $model = new ConfigModel();
        $key = explode(',',$key);
        $data = $model->field('key,name,value')->where('key','in',$key)->select();
        return apiResult('2000','获取成功',$data);
    }


}
